package com.hyou.starter.autoconfigure.mybatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.hyou.common.base.BaseBean;

/**
 * mybatis配置文件参数、mapper加载配置参数
 * 
 * @author FengChangshuo
 * @version 1.0.0 2018-03-22 13:40:19 初始创建
 */
public class MybatisResourceProp extends BaseBean {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -1036940410106076788L;
    
    /**
     * mybatis-config.xml配置文件加载路径。默认："classpath:mybatis-config.xml"
     */
    private String mybatisConfig;
    
    /**
     * Mapper文件资源加载路径。默认加载mappers目录下所有*Mapper.xml文件
     */
    private List<String> resourcePatterns;
    
    /**
     * 针对不同的数据源加载不同的mybatis配置时，使用该方式
     */
    private Map<String, MybatisResourceProp> mybatisMap = new HashMap<>();

    /**
     * @return mybatis-config.xml配置文件加载路径。默认："classpath:mybatis-config.xml"
     */
    public String getMybatisConfig() {
        return this.mybatisConfig;
    }

    /**
     * @param mybatisConfig mybatis-config.xml配置文件加载路径。默认："classpath:mybatis-config.xml"
     */
    public void setMybatisConfig(String mybatisConfig) {
        this.mybatisConfig = mybatisConfig;
    }

    /**
     * @return Mapper文件资源加载路径。默认加载mappers目录下所有*Mapper.xml文件
     */
    public List<String> getResourcePatterns() {
        return this.resourcePatterns;
    }

    /**
     * @param resourcePattern Mapper文件资源加载路径。默认加载mappers目录下所有*Mapper.xml文件
     */
    public void setResourcePatterns(List<String> resourcePatterns) {
        this.resourcePatterns = resourcePatterns;
    }

    /**
     * @return the mybatisMap
     */
    public Map<String, MybatisResourceProp> getMybatisMap() {
        return this.mybatisMap;
    }

    /**
     * @param mybatisMap the mybatisMap to set
     */
    public void setMybatisMap(Map<String, MybatisResourceProp> mybatisMap) {
        this.mybatisMap = mybatisMap;
    }
    
}
